<template>
  <div @click="f1">
    <!-- 获取事件对象参数 -->
    <!-- <a href="https://www.baidu.com" @click="goto">点我试试</a>
    <a href="https://www.baidu.com" @click="goto1(1,$event)">点我试试</a> -->

    <!-- 修饰符 .stop .prevent -->
  <button @click.stop="f2">点我试试</button>
  <a href="https://www.baidu.com" @click.prevent.stop="goto1(1,$event)">点我试试</a>
  </div>
</template>

<script>
export default {
  methods:{
    goto(e){
      console.log(e);
      e.preventDefault()
    },
    goto1(n,e){
      console.log(e);
      // e.preventDefault()
    },
    f1(){
      console.log('f1');
    },
    f2(){
      console.log('f2');
    }
  }
}
</script>

<style>

</style>